Introduction to Medical Statistics 2024
Exercise class III
Statistical Analysis: Main Concepts and Principles

Author

Ronald Geskus

Published

August 20, 2024

I. Calculation of binomial probabilities

The US CDC estimates that 90% of Americans have had chickenpox by the time they reach adulthood.

  1. Suppose we take a random sample of 100 American adults. Is the use of the binomial distribution appropriate for calculating the probability that exactly 97 out of 100 randomly sampled American adults had chickenpox during childhood? Explain your answer.
  1. How many American adults that had chickenpox would you expect to observe among the 100? Wat is the variance of the number of observed cases among 100 sampled individuals? Use the dbinom function to calculate the probability that exactly 97 out of 100 randomly sampled American adults had chickenpox during childhood, i.e. compute P(X=97) if X \(\sim\) B(0.9,100).
  1. What is the probability that exactly 3 out of a new sample of 100 American adults have not had chickenpox in their childhood?
  1. Plot the probability function of this binomial distribution. See whether the answer from b. corresponds with the value in the plot. Which number has the highest probability and how large is that probability?
  1. What’s the probability that we observe a number of adults that is at least 5 lower or higher than 90? Hint: use the pbinom function to compute \(P(X \leq 85)\) and \(P(X \geq 95)\). How do you read this number from the plot that you made in b?
  1. We actually calculate the p-value of a test of the null hypothesis that p is 0.9 against the two-sided alternative hypothesis that there is a difference if the observed number of infected individuals is 95. Why?

II: Inference for a single proportion

A new chemotherapy has entered phase 2 in drug development. The tumour response probability is defined as the fraction of patients that achieves a decrease in tumour size by at least 50% within 6 months after therapy initiation. According to experts, the tumour response probability of the drug should be more than 20% in order to proceed to a phase 3 study.

The statistical test of interest is the test for a single proportion with the null hypothesis \(H_0: \pi=0.2\) (or \(H_0: \pi \leq 0.2\)) versus the alternative \(H_A: \pi >0.2\). The phase 2 trial consists of 50 patients. We observe the tumour response for each patient and then perform the statistical test.

  1. Assume that 16/50 patients showed a tumour response. Calculate the corresponding one-sided p-value and describe the result and your conclusion in words. Hint: You can either calculate the p-value yourself using the binomial distribution (as in Exercise I.b) or you can use the prop.test or binom.test function. (Note that these two functions use different methods; only binom.test gives the same answer as the direct calculation.)
  1. The experts expected a tumour response of 40%. Suppose that the true tumour response probability is indeed 0.4. We reject the null hypothesis if we get a one-sided p-value smaller than 0.025. What is the probability that we reject the null hypothesis if we have a sample of 50 patients (not the current sample, but an arbitrary new sample)? This is the basis of the so-called power or sample size calculation. Hint: First show that for an observed number of tumour responses of 16 the test does not reject the null hypothesis, while for 17 it does. Then calculate the probability of \(P(X\geq 17)\) if the alternative is true, i.e. if p=0.4.

III: Analysis of a diagnostic test

A diagnostic study evaluated the Platelia NS1 ELISA assay for diagnosis of dengue. The study participants consisted of 853 children admitted to Children’s Hospital #1, Children’s Hospital #2, or HTD from August 2006 to March 2007. Participants were eligible for entry to the study if they had a history of fever of less than seven days and there was a clinical suspicion of dengue. A patient was classified as having dengue by the reference test (gold standard) if there was RT-PCR detection of DENV RNA in plasma, and/or viral culture and/or serological changes in DENV reactive IgM or IgG levels in paired plasma specimens. The data is stored in dengueNS1.csv, the file dengueNS1_description.txt describes the variables in the data set.

Import the dataset.

  1. Use the table function to create a cross-table; you can add column and row totals via the addmargins function. Calculate the prevalence (proportion) of children with dengue.
  1. Calculate the proportion of children with dengue that test positive in the NS1 assay. This quantity is called the sensitivity “SENS” of the test. Also calculate the proportion of children without dengue that test negative (the specificity “SPEC” of the test). Write the function to answer that in the blank below.
  1. Calculate the proportion of children that have dengue amongst the ones that test positive in the NS1 assay. This is called the positive predictive value (PPV). Also calculate the proportion of children that do not have dengue amongst the ones that test negative in the NS1 assay. Which characteristic of the test is more clinically relevant, SENS and SPEC or PPV and NPV? Write the function to answer that in the blank below.
  1. Is there evidence for a difference in sensitivity of the NS1 ELISA assay between DENV serotypes? Use the tbl_summary function from the gtsummary package (No statistical test is required, just an exploratory data analysis.)

IV: difference in proportions

The dataset bmData.csv contains selected variables from 300 patients with confirmed bacterial meningitis. They were randomized to either adjunctive dexamethasone therapy or placebo. Import the dataset.

  1. Create a 2x2 table that compares the number of deaths at 6 months between the two treatment arms, using the function xtabs or table. Is there a difference in the survival status at 6 months of follow-up between the two randomized groups?
  1. Perform a formal test for a difference in survival status. Formulate the null hypothesis and the alternative hypothesis. Use the chisq.test function.
  1. Use the prop.test function as alternative. Look at the difference in the way the results are shown compared to the chi-squared test.